package com.example.smarthome;

import java.util.*;

public class SceneMode {
    private String sceneName;
    private List<SmartDevice> devices;

    public SceneMode(String sceneName) {
        this.sceneName = sceneName;
        this.devices = new ArrayList<>();
    }

    public void addDevice(SmartDevice device) {
        devices.add(device);
        System.out.println(device.deviceName + " 已加入场景 " + sceneName);
    }

    public void applyScene() {
        System.out.println("\n🌟 正在应用场景：" + sceneName + " 🌟");
        for (SmartDevice d : devices) {
            d.turnOn();
        }
        System.out.println("✅ 场景 '" + sceneName + "' 已应用完毕。\n");
    }

    public void closeScene() {
        System.out.println("\n🌙 正在关闭场景：" + sceneName + " 🌙");
        for (SmartDevice d : devices) {
            d.turnOff();
        }
        System.out.println("📴 场景 '" + sceneName + "' 已关闭。\n");
    }
}